package com.cx.model.ai;

import com.cx.entity.RestResp;
import com.cx.model.ai.entity.AiDto;
import com.cx.model.ai.entity.Chat;
import com.cx.model.ai.service.Base;
import com.cx.model.ai.service.LlmApi;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: pms
 * @author: cx
 * @description: 知识库接口控制层
 * @create: 2025-03-19 15:27
 **/
@RestController
@RequestMapping("/lim")
public class LlmController {

    @Resource
    private LlmApi llmApiService;
    @PostMapping("/doChat")
    public RestResp doChat(@RequestBody Chat chat) {
        // 添加日志，打印接收到的参数
        System.out.println("Received aiDto: " + chat.toString());
        RestResp restResp = llmApiService.doChat(chat);
        return restResp;
    }

}